package com.baidu.fenfayun.demo.util
import android.graphics.drawable.*
import android.graphics.*
import net.steamcrafted.materialiconlib.*
import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
import android.content.*

object IconUtil{

   fun getImage(context:Context ,stype: MaterialDrawableBuilder.IconValue ):Drawable {
      val yourDrawable = MaterialDrawableBuilder.with(context) // provide a context
         .setIcon(stype) // provide an icon
         .setColor(Color.WHITE) // set the icon color
         .setToActionbarSize() // set the icon size
         .build()
      return yourDrawable
   }
   fun getDraw(context:Context ,stype: MaterialDrawableBuilder.IconValue ):MaterialDrawableBuilder {
      val yourDrawable = MaterialDrawableBuilder.with(context) // provide a context
         .setIcon(stype) // provide an icon
         .setColor(Color.WHITE) // set the icon color
         .setToActionbarSize() // set the icon size
         /*.build()*/
      return yourDrawable
   }
   fun generateImageButton(imageResourceId:Int,context:Context ):QMUIAlphaImageButton  {
      val backButton = QMUIAlphaImageButton(context)
      backButton.setBackgroundColor(Color.TRANSPARENT)
      backButton.setImageResource(imageResourceId)
      return backButton
   }

   fun generateImageButton(drawable:Drawable ,context:Context ):QMUIAlphaImageButton  {
      val backButton = QMUIAlphaImageButton(context)
      backButton.setBackgroundColor(Color.TRANSPARENT)
      backButton.setImageDrawable(drawable)
      return backButton
   }

}
